package com.ds.infrastructure.hyperspace.console.dto.apirouter;

import com.ds.infrastructure.hyperspace.console.dto.configdata.NodesDTO;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author: yaozhendong
 * @create: 2019-09-20 16:15
 **/
@Data
@NoArgsConstructor
public class ApiRouterNodesDTO implements Serializable {
    private String protocol;
    private String host;
    private String zone;
    private int port;

    public static ApiRouterNodesDTO toApiRouter(NodesDTO dto) {
        ApiRouterNodesDTO apiRouterNodesDTO = new ApiRouterNodesDTO();
        apiRouterNodesDTO.setProtocol(dto.getProtocol());
        apiRouterNodesDTO.setHost(dto.getHost());
        apiRouterNodesDTO.setZone(dto.getZone());
        apiRouterNodesDTO.setPort(dto.getPort());
        return apiRouterNodesDTO;

    }
}
